package com.wys.mall.product.webcontroller;

import com.wys.mall.product.entity.CategoryEntity;
import com.wys.mall.product.redis.RedisTool;
import com.wys.mall.product.service.CategoryService;
import com.wys.mall.product.service.SkuInfoService;
import com.wys.mall.product.vo.Catelog2Vo;
import com.wys.mall.product.vo.SkuItemVo;
import org.redisson.api.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutionException;

/**
 * 页面跳转
 *
 * @Package com.wys.mall.product.webcontroller
 * @Author charlin
 * @Version: v1.0
 * @Date 2021-06-2610:28
 * @Copyright: 2021 www.wyscha.com Inc. All rights reserved.
 */
@Controller
public class ItemController {

    @Autowired
    private SkuInfoService skuInfoService;

    /**
     * 跳转到首页
     * @return
     */
    @GetMapping("/{skuId}.html")
    public String skuItem(@PathVariable("skuId") Long skuId, Model model) throws ExecutionException, InterruptedException {
        SkuItemVo vos = skuInfoService.item(skuId);
        model.addAttribute("item",vos);
        return "item";
    }

}
